﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using L = Science.Mathematics.LinearAlgebra;

namespace Strang3Ed.Chapter06.Section4
{
    public class Example01
    {
        public Example01()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
        public void Compute()
        {
            double[,] x = { {1.0, 2.0}, 
                            {2.0, 4.0}};

            L.SymmetricMatrix A = new L.SymmetricMatrix(x);
            A.Diagonalize();

            result += A.Eigenvalue[0].ToString() + "\r\n";

            result += A.Eigenvector[0].ToString() + "\r\n";

            result += A.Eigenvalue[1].ToString() + "\r\n";

            result += A.Eigenvector[1].ToString() + "\r\n";
        }
    }
}
/*
5
0.447213595499958
0.894427190999916

0
0.894427190999916
-0.447213595499958
*/


